Telegram Group & Telegram Channel
Находим наименьшие и наибольшие

В стандартной библиотеке есть модуль heapq, который, как можно понять по названию, реализует структуру данных куча.

Особенности и пользу этой структуры данных пока что разбирать не будем, но посмотрим на два интересных метода в этом модуле.

С помощью методов nsmallest и nlargest можно получить наименьшие и наибольшие элементы в списке.

Первым аргументов передается, сколько элементов нужно взять, вторым — список.

#heap



tg-me.com/python_academy/955
Create:
Last Update:

Находим наименьшие и наибольшие

В стандартной библиотеке есть модуль heapq, который, как можно понять по названию, реализует структуру данных куча.

Особенности и пользу этой структуры данных пока что разбирать не будем, но посмотрим на два интересных метода в этом модуле.

С помощью методов nsmallest и nlargest можно получить наименьшие и наибольшие элементы в списке.

Первым аргументов передается, сколько элементов нужно взять, вторым — список.

#heap

BY Python Academy




Share with your friend now:
tg-me.com/python_academy/955

View MORE
Open in Telegram


Python Academy Telegram | DID YOU KNOW?

Date: |

How to Use Bitcoin?

n the U.S. people generally use Bitcoin as an alternative investment, helping diversify a portfolio apart from stocks and bonds. You can also use Bitcoin to make purchases, but the number of vendors that accept the cryptocurrency is still limited. Big companies that accept Bitcoin include Overstock, AT&T and Twitch. You may also find that some small local retailers or certain websites take Bitcoin, but you’ll have to do some digging. That said, PayPal has announced that it will enable cryptocurrency as a funding source for purchases this year, financing purchases by automatically converting crypto holdings to fiat currency for users. “They have 346 million users and they’re connected to 26 million merchants,” says Spencer Montgomery, founder of Uinta Crypto Consulting. “It’s huge.”

A Telegram spokesman declined to comment on the bond issue or the amount of the debt the company has due. The spokesman said Telegram’s equipment and bandwidth costs are growing because it has consistently posted more than 40% year-to-year growth in users.

Python Academy from us


Telegram Python Academy
FROM USA